using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace  EasyNetWork
{
    public sealed partial class EventPool<T> where T : BaseEventArgs
    {
        /// <summary>
        /// 封装了个事件结点
        /// </summary>
        public class EasyEvent
        {
            private object m_Sender;
            private T m_EventArgs;

            public EasyEvent()
            {
                m_Sender = null;
                m_EventArgs = null;
            }

            public object Sender
            {
                get
                {
                    return m_Sender;
                }
            }

            public T EventArgs
            {
                get
                {
                    return m_EventArgs;
                }
            }

            public static EasyEvent Create(object sender,T e)
            {
                EasyEvent eventmode = new EasyEvent();
                eventmode.m_Sender = sender;
                eventmode.m_EventArgs = e;
                return eventmode;
            }
            
            public void Clear()
            {
                m_Sender = null;
                m_EventArgs = null;
            }
        }

    }

}
